﻿namespace System.Net.Util
{
    internal class DoubleLinkList : DoubleLink
    {
        internal DoubleLinkList() { }
        internal DoubleLinkListEnumerator GetEnumerator() { return new DoubleLinkListEnumerator(this); }
        internal virtual void InsertHead(DoubleLink entry) { entry.InsertAfter(this); }
        internal virtual void InsertTail(DoubleLink entry) { entry.InsertBefore(this); }
        internal bool IsEmpty() { return (_next == this); }
        internal int Length
        {
            get
            {
                int num = 0;
                var enumerator = GetEnumerator();
                while (enumerator.MoveNext())
                    num++;
                return num;
            }
        }
    }
}
